package com.ruoyi.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.domain.JkPraiseRecords;
import com.ruoyi.mapper.JkPraiseRecordsMapper;
import com.ruoyi.service.IJkPraiseRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 点赞Service业务层处理
 *
 * @author ruoyi
 * @date 2023-09-13
 */
@Service
public class JkPraiseRecordsServiceImpl implements IJkPraiseRecordsService
{
    @Autowired
    private JkPraiseRecordsMapper jkPraiseRecordsMapper;

    /**
     * 查询点赞
     *
     * @param id 点赞主键
     * @return 点赞
     */
    @Override
    public JkPraiseRecords selectJkPraiseRecordsById(Long id)
    {
        return jkPraiseRecordsMapper.selectJkPraiseRecordsById(id);
    }

    /**
     * 查询点赞列表
     *
     * @param jkPraiseRecords 点赞
     * @return 点赞
     */
    @Override
    public List<JkPraiseRecords> selectJkPraiseRecordsList(JkPraiseRecords jkPraiseRecords)
    {
        return jkPraiseRecordsMapper.selectJkPraiseRecordsList(jkPraiseRecords);
    }

    /**
     * 新增点赞
     *
     * @param jkPraiseRecords 点赞
     * @return 结果
     */
    @Override
    public int insertJkPraiseRecords(JkPraiseRecords jkPraiseRecords)
    {
        jkPraiseRecords.setCreateTime(DateUtils.getNowDate());
        return jkPraiseRecordsMapper.insertJkPraiseRecords(jkPraiseRecords);
    }

    /**
     * 修改点赞
     *
     * @param jkPraiseRecords 点赞
     * @return 结果
     */
    @Override
    public int updateJkPraiseRecords(JkPraiseRecords jkPraiseRecords)
    {
        return jkPraiseRecordsMapper.updateJkPraiseRecords(jkPraiseRecords);
    }

    /**
     * 批量删除点赞
     *
     * @param ids 需要删除的点赞主键
     * @return 结果
     */
    @Override
    public int deleteJkPraiseRecordsByIds(Long[] ids)
    {
        return jkPraiseRecordsMapper.deleteJkPraiseRecordsByIds(ids);
    }

    /**
     * 删除点赞信息
     *
     * @param id 点赞主键
     * @return 结果
     */
    @Override
    public int deleteJkPraiseRecordsById(Long id)
    {
        return jkPraiseRecordsMapper.deleteJkPraiseRecordsById(id);
    }
}
